package org.example.springlog;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/Log")
@RestController
public class LogController {
    //使用日志框架打印日志
    //两步①获取日志对象②打印日志
    private static Logger logger= LoggerFactory.getLogger(LoggerFactory.class);
    @RequestMapping("/print")
    public String print()
    {
        System.out.println("打印日志");
        logger.info("Logger 打印日志");
        logger.trace("logger trace");
        logger.error("logger error");
        return "打印日志";
    }
}


